home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / C Guide / Average_Module1 / includes / buildin.strings < prev    next >
Text File  |  1998-09-05  |  3KB  |  168 lines

  1. #ifndef BUILDIN_H
  2. #define BUILDIN_H
  3.  
  4.  
  5. /****************************************************************************/
  6.  
  7.  
  8. /* This file was created automatically by CatComp.
  9.  * Do NOT edit by hand!
  10.  */
  11.  
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifdef CATCOMP_ARRAY
  18. #undef CATCOMP_NUMBERS
  19. #undef CATCOMP_STRINGS
  20. #define CATCOMP_NUMBERS
  21. #define CATCOMP_STRINGS
  22. #endif
  23.  
  24. #ifdef CATCOMP_BLOCK
  25. #undef CATCOMP_STRINGS
  26. #define CATCOMP_STRINGS
  27. #endif
  28.  
  29.  
  30. /****************************************************************************/
  31.  
  32.  
  33. #ifdef CATCOMP_NUMBERS
  34.  
  35. #define FUNC0_DESCRIPTION 0
  36. #define MSG_ACTIVATE 1
  37. #define MSG_APPEAR 2
  38. #define MSG_DISAPPEAR 3
  39. #define MSG_REMOVE 4
  40. #define MSG_SAVE_POS 5
  41. #define MSG_QUIT 6
  42. #define MSG_TEXT 7
  43. #define MSG_CX_DESCR 8
  44.  
  45. #endif /* CATCOMP_NUMBERS */
  46.  
  47.  
  48. /****************************************************************************/
  49.  
  50.  
  51. #ifdef CATCOMP_STRINGS
  52.  
  53. #define FUNC0_DESCRIPTION_STR "DOpus Exchange"
  54. #define MSG_ACTIVATE_STR "Activated"
  55. #define MSG_APPEAR_STR "Appear"
  56. #define MSG_DISAPPEAR_STR "Disappear"
  57. #define MSG_REMOVE_STR "Remove"
  58. #define MSG_SAVE_POS_STR "Save settings"
  59. #define MSG_QUIT_STR "Quit"
  60. #define MSG_TEXT_STR "Exchange"
  61. #define MSG_CX_DESCR_STR "Control commodity programs"
  62.  
  63. #endif /* CATCOMP_STRINGS */
  64.  
  65.  
  66. /****************************************************************************/
  67.  
  68.  
  69. #ifdef CATCOMP_ARRAY
  70.  
  71. struct CatCompArrayType
  72. {
  73.     LONG   cca_ID;
  74.     STRPTR cca_Str;
  75. };
  76.  
  77. static const struct CatCompArrayType CatCompArray[] =
  78. {
  79.     {FUNC0_DESCRIPTION,(STRPTR)FUNC0_DESCRIPTION_STR},
  80.     {MSG_ACTIVATE,(STRPTR)MSG_ACTIVATE_STR},
  81.     {MSG_APPEAR,(STRPTR)MSG_APPEAR_STR},
  82.     {MSG_DISAPPEAR,(STRPTR)MSG_DISAPPEAR_STR},
  83.     {MSG_REMOVE,(STRPTR)MSG_REMOVE_STR},
  84.     {MSG_SAVE_POS,(STRPTR)MSG_SAVE_POS_STR},
  85.     {MSG_QUIT,(STRPTR)MSG_QUIT_STR},
  86.     {MSG_TEXT,(STRPTR)MSG_TEXT_STR},
  87.     {MSG_CX_DESCR,(STRPTR)MSG_CX_DESCR_STR},
  88. };
  89.  
  90. #endif /* CATCOMP_ARRAY */
  91.  
  92.  
  93. /****************************************************************************/
  94.  
  95.  
  96. #ifdef CATCOMP_BLOCK
  97.  
  98. static const char CatCompBlock[] =
  99. {
  100.     "\x00\x00\x00\x00\x00\x10"
  101.     FUNC0_DESCRIPTION_STR "\x00\x00"
  102.     "\x00\x00\x00\x01\x00\x0A"
  103.     MSG_ACTIVATE_STR "\x00"
  104.     "\x00\x00\x00\x02\x00\x08"
  105.     MSG_APPEAR_STR "\x00\x00"
  106.     "\x00\x00\x00\x03\x00\x0A"
  107.     MSG_DISAPPEAR_STR "\x00"
  108.     "\x00\x00\x00\x04\x00\x08"
  109.     MSG_REMOVE_STR "\x00\x00"
  110.     "\x00\x00\x00\x05\x00\x0E"
  111.     MSG_SAVE_POS_STR "\x00"
  112.     "\x00\x00\x00\x06\x00\x06"
  113.     MSG_QUIT_STR "\x00\x00"
  114.     "\x00\x00\x00\x07\x00\x0A"
  115.     MSG_TEXT_STR "\x00\x00"
  116.     "\x00\x00\x00\x08\x00\x1C"
  117.     MSG_CX_DESCR_STR "\x00\x00"
  118. };
  119.  
  120. #endif /* CATCOMP_BLOCK */
  121.  
  122.  
  123. /****************************************************************************/
  124.  
  125.  
  126. struct LocaleInfo
  127. {
  128.     APTR li_LocaleBase;
  129.     APTR li_Catalog;
  130. };
  131.  
  132.  
  133. #ifdef CATCOMP_CODE
  134.  
  135. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  136. {
  137. LONG   *l;
  138. UWORD  *w;
  139. STRPTR  builtIn;
  140.  
  141.     l = (LONG *)CatCompBlock;
  142.  
  143.     while (*l != stringNum)
  144.     {
  145.         w = (UWORD *)((ULONG)l + 4);
  146.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  147.     }
  148.     builtIn = (STRPTR)((ULONG)l + 6);
  149.  
  150. #undef LocaleBase
  151. #define LocaleBase li->li_LocaleBase
  152.     
  153.     if (LocaleBase)
  154.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  155. #undef LocaleBase
  156.  
  157.     return(builtIn);
  158. }
  159.  
  160.  
  161. #endif /* CATCOMP_CODE */
  162.  
  163.  
  164. /****************************************************************************/
  165.  
  166.  
  167. #endif /* BUILDIN_H */
  168.